package com.kksoft.readcm.pro.a;

import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Build.VERSION;
import com.kksoft.readcm.activity.App;
import com.kksoft.readcm.objects.m;
import com.kksoft.readcm.pro.service.PushSyncService;

public final class b
{
  public static String a = "support@readitlaterlist.com";
  private a b;

  public static b a()
  {
    if ((App.e().a()) && (Build.VERSION.SDK_INT >= 8))
    {
    	return new b();
    }
    else
    	return null;
  }

  private void a(boolean paramBoolean, String paramString)
  {
    if (this.b != null)
      this.b.a(paramBoolean, paramString);
    this.b = null;
  }

  public static void startService(Context context)
  {
	context.startService(new Intent(context, PushSyncService.class));
  }

  public final void a(Context context)
  {
    this.b = null;
    Intent localIntent1 = new Intent("com.google.android.c2dm.intent.UNREGISTER");
    Intent localIntent2 = localIntent1.setPackage("com.google.android.gsf");
    Intent localIntent3 = new Intent();
    PendingIntent localPendingIntent = PendingIntent.getBroadcast(context, 0, localIntent3, 0);
    Intent localIntent4 = localIntent1.putExtra("app", localPendingIntent);
    context.startService(localIntent1);
  }

  public final void a(Context paramContext, a parama)
  {
    if (parama != null)
      this.b = parama;
    String str = a;
    com.google.android.c2dm.a.a(paramContext, str);
  }

  public final void a(String paramString)
  {
    if (paramString.equals("ACCOUNT_MISSING"))
      App.getAppString(2131165304);
      else if (paramString.equals("AUTHENTICATION_FAILED"))
    	  App.getAppString(2131165305);
      else if (paramString.equals("TOO_MANY_REGISTRATIONS"))
    	  App.getAppString(2131165306);
      else App.getAppString(2131165303);
  }

  public final void b(String paramString)
  {
    c localc = new c(this, paramString);
    Void[] arrayOfVoid = new Void[0];
    AsyncTask localAsyncTask = localc.execute(arrayOfVoid);
  }
}